package com.study.throwtest;

import java.util.UUID;

/**
 * 如何避免空指针
 */
public class ThrowTest {
    private final static String SUCCESS="success";

    public static void main(String[] args) {
        /*Object object=null;
        String str=object.toString();*/

        String status=null;
         /*  if (status.equals(SUCCESS)){

        }*/
        /***** 1、字符串比较，常量放前面*****/
        if (SUCCESS.equals(status)){
            System.out.println("SUCCESS");
        }
        /***** 2、初始化默认值*****/
        /*Person person=new Person();
        String name= StringUtils.EMPTY;*/
       System.out.println(UUID.randomUUID());

    }

}
